Skip to content

Add middleware helpers for Mina#393

Draft
SpaceManiac wants to merge 35 commits intomasterfrom
patch/mina-middleware
Draft

Add middleware helpers for Mina#393
SpaceManiac wants to merge 35 commits intomasterfrom
patch/mina-middleware

Conversation

@SpaceManiac
Copy link
Copy Markdown
Contributor

@SpaceManiac SpaceManiac commented Jul 15, 2024

Draft pending #389.


  • Improve exported API of mina-delegation package to deal with usability issues.
    • Rename DelegationOrder to DelegationCommand.
  • Add MinaDelegationCache to @paima-sdk/providers.
    • Given a gameName, this uses localStorage + a background worker to generate and cache a DelegationCommand proof.
    • Necessitated some build system fixups.
  • Let some IProvider.signMessage implementations accept Uint8Array in addition to string.
    • Mina itself is excluded because Auro Wallet's API accepts strings only.
    • Therefore the IProvider interface itself only accepts string still.
    • It's still not advised to pass non-UTF-8 data, e.g. EVM personal_sign data is treated as text, so it won't look pretty.
    • Mainly included because of code improvements to how the strings get hex'd.

TODO:

  • (?) Rename mina-delgation back to mina-contracts since caching is out & no longer demands that we split packages per program/contract.

Demo at PaimaStudios/paima-game-templates#81.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant